<template>
	<view class="content bgc-f0">
		<view class="" style="position: sticky;top: 0;">
			<view class="p26 bgc-fff search_sticky">
				<u-search 
					placeholder="请输入客户姓名,手机号等关键字" 
					v-model="value" 
					shape="round" 
					@blur="getStreamData"
					@search="getStreamData" 
					@custom="getStreamData">
				</u-search>
			</view>
			<u-tabs :list="tabList" :is-scroll="false" v-model="current" @change="handChange" active-color="#23bbb3"
				bg-color="#f8f8f8"></u-tabs>
		</view>

		<template v-if="list.length > 0">
			<template v-for="(it,index) in 9">
				<view class="_li">
					<view class="bd1 mr20" style="width: 110rpx;height: 110rpx;">

					</view>
					<view class="flex-1 fs26 z-flex z-flex-around" style="flex-direction: column;">
						<view class="z-flex z-flex-align-c z-flex-between">
							<text class="fs30">姓名(15182916740)</text>
						</view>
						<view class="z-flex z-flex-align-c">
							<text class="mr40">2024-02-06 20:25:25</text>
							<text>加入</text>
						</view>
					</view>
				</view>
			</template>
		</template>

		<vempty v-show="dataLe" title="暂无数据"></vempty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				dataLe: false,
				list: [],
				tabList: [],
				current: 0
			}
		},
		onShow() {
			this.getStreamData()
			setTimeout(()=>{
				this.tabList = [{
					name: '1980元',
					count: 15
				}, {
					name: '3980元',
					count: 10
				},{
					name: '6980元',
					count: 15
				}, {
					name: '9980元',
					count: 10
				}, {
					name: '13380元',
					count: 0
				}]
			},500)
		},
		methods: {
			getStreamData() {
				this.dataLe = false
				this.list = []
				uni.showLoading({
					title: '数据加载中...',
					icon: 'none'
				})

				setTimeout(() => {
					if(this.current === 4){
						this.dataLe = true
						this.list = []
					}else{
						this.dataLe = false
						this.list = [{
							name: '张三'
						}, {
							name: '李四'
						}, {
							name: '李奎'
						}]
					}
					
					uni.hideLoading()
				}, 1000)
			},
			handBlurEvent(e) {
				this.getStreamData()
			},
			handChange(index) {
				this.getStreamData()
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		width: 100vw;
		height: 100vh;
		overflow-y: auto;

		._li {
			display: flex;
			padding: 26rpx;
			border-bottom: 1rpx solid #F8F8F8;
			background-color: #FFFFFF;
		}
	}
</style>
